//logs.js
const util = require('../../utils/util.js')

Page({
  data: {
    logs: [],
    menulist: [
      { "id": "1", "url": "/images/top.png", "title": "顶部" },
      { "id": "2", "url": "/images/add.png", "title": "添加" },
      { "id": "3", "url": "/images/buy.png", "title": "购物车" },
    ],
    mainmodel: { "url": "/images/home.png", "title": "菜单" }
  },
  onLoad: function () {
    this.setData({
      logs: (wx.getStorageSync('logs') || []).map(log => {
        return util.formatTime(new Date(log))
      })
    })
    
  },
  menuItemClick: function (res) {
    console.log(res);
    //获取点击事件的信息
    let clickInfo = res.detail.iteminfo
    console.log(clickInfo);
    // 根据不同类型进行判别处理
    //事件的处理 代码

  }
})
